package com.hfkz.project.action;

import org.apache.commons.lang.StringUtils;

import com.hfkz.project.domain.Client;
import com.hfkz.project.serivce.ClientService;

public class LoginAction extends BaseAction {
	
	private Client client;
	private ClientService clientService = new ClientService();
	
	private String account;
	private String pwd;
	private String nickname;
	private String balance;
	
	public String execute(){
		return SUCCESS;
	}
	
	public String login(){
		
		if(StringUtils.isBlank(this.account)) {
			return "failure";
		}
		else{				//取出password，与数据库中的对比，如果相同，则跳转到买书页面
			
			return SUCCESS;
		}
	}
	
	public String register(){
		
		clientService.insert(client);
		
		return SUCCESS;
	}
	

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

}
